#include <iostream>
#include <string>
#include "sigslot.h"
#include "wxdialog.h"
#include "hexdialog.h"

#include "model.h"
#include "view.h"

int main(int argc, char* argv[])
{
    #if 0
    wxDialog granDialogo; // emite signals
    HexDialog hexDialogo; // recibe signals en los slots
    
    // conectando signals a slots
    granDialogo.Closed.connect(&hexDialogo, &HexDialog::OnCloseWindow);
    granDialogo.StateChanged.connect(&hexDialogo, &HexDialog::OnStateChanged);
    granDialogo.Resized.connect(&hexDialogo, &HexDialog::OnSize);
    granDialogo.KeyPressed.connect(&hexDialogo, &HexDialog::OnKeyPress);
    granDialogo.OKed.connect(&hexDialogo, &HexDialog::OnOK);
    
    // llamadas que haria el sistema/usuario
    granDialogo.KeyPressed.emit('h');
    granDialogo.KeyPress('j');
    granDialogo.Maximize();
    
    std::cout << "Press 3 keys: ";
    granDialogo.KeyPress(std::cin.get());
    granDialogo.KeyPress(std::cin.get());
    granDialogo.KeyPress(std::cin.get());
    
    granDialogo.Size(500,20);
    #endif
    
    // ---------------------------------------------------------------------------------------------
    
    Model doc;
    TextView v1(doc);
    HexView v2(doc);

    doc.Append(argc == 2 ? argv[1] : "Hello seniales!!");
    doc.Refreshed.disconnect(&v2);
    doc.Append(" Hola otra vez!");
    
    return 0;
}
